<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!--edge浏览器H5兼容设置-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--360浏览器H5兼容设置-->
    <meta name="renderer" content="webkit" />
    <title>导航页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--导入核心文件-->
    <script src="../bootstrap3/js/holder.js"></script>
    <link href="../bootstrap3/css/bootstrap.css" rel="stylesheet" type="text/css">
    <script src="../bootstrap3/jquery-1.9.1.min.js"></script>
    <script src="../bootstrap3/js/bootstrap.js"></script>
    <!-- 字体图标 -->
    <link rel="stylesheet" href="../bootstrap3/font-awesome-4.7.0/css/font-awesome.css" />

    <script src="../bootstrap3/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../css/home.css"/>

</head>
<body>
<!--网页最上方的留白-->
<header>
    <!-- class.container 容器定位 的作用是进行居中布局 -->
    <div class="container">
        <!-- pull-right 向右对齐  -->
        <span class="pull-right"><small>Sports  Equipment</small> <b>Management</b>System</span>

    </div>
</header>
<!--网页 导航栏 在layout.css 文件中设置背景图片-->
<nav>
    <!-- class.container 容器定位 用于设置内容居中 -->
    <div class="container">
        <h1>
            <b>体育器材管理系统</b> <small>——Design by Z</small>
        </h1>

        <!--导航栏-->
        <div>
            <!-- class="nav navbar-nav" 定义导航条 -->
            <ul class="nav navbar-nav">
                <li><a href="home.html">首页</a></li>

            </ul>
            <!-- class="nav navbar-nav" 定义导航条 向右侧浮动 -->
            <ul class="nav navbar-nav navbar-right">
                <!-- 导航条中的文字使用 class="navbar-text" 样式 -->
                <li><span class="navbar-text"></span></li>
                <li><a id="loginout"><span class="glyphicon glyphicon-off" aria-hidden="true"></span></a></li>
            </ul>
        </div>
        <!-- /导航栏 -->
    </div>
</nav>
<!--主体-->
<section>
    <div class="services-section">
        <div class="inner-width">
            <h1 class="section-title">Our Service</h1>
            <div class="border"></div>
            <div class="services-container">
                <div class="service-box">
                    <div class="service-icon">
                        <i id="btn1" class="glyphicon glyphicon-folder-open" style="margin-left: 10px"></i>
                    </div>
                    <div class="service-title">体育器材管理</div>
                    <div class="service-desc">
                        上传并展示价格表，器材 <br>表自动生成供应商表
                    </div>
                </div>
                <div class="service-box">
                    <div class="service-icon">
                        <i id="btn2" class="glyphicon glyphicon-retweet" style="margin-left: 10px"></i>
                    </div>
                    <div class="service-title">器材借还管理</div>
                    <div class="service-desc">
                        管理员工对器材的借还<br>情况。包括身份验证<br>以及归还情况的查看
                        <br>
                        <br>
                        <br>
                    </div>
                </div>
                <div class="service-box">
                    <div class="service-icon">
                        <i id="btn3" class="glyphicon glyphicon-user" style="margin-left: 10px"></i>
                    </div>
                    <div class="service-title">管理员个人信息</div>
                    <div class="service-desc">
                        对当前管理员的信息进行 <br> 查看或修改
                    </div>
                </div>
                <div class="service-box">
                    <div class="service-icon">
                        <i id="btn4" class="glyphicon glyphicon-shopping-cart" style="margin-left: 10px"></i>
                    </div>
                    <div class="service-title">器材报废登记</div>
                    <div class="service-desc">
                        登记报废器材，生成、修<br>改以及导出采购清单
                    </div>
                </div>
                <div class="service-box">
                    <div class="service-icon">
                        <i id="btn5" class="glyphicon glyphicon-pencil" style="margin-left: 10px"></i>
                    </div>
                    <div class="service-title">信息录入</div>
                    <div class="service-desc">
                        用户信息录入<br>以及体育器材信息录入
                    </div>
                </div>

            </div>
        </div>
    </div>

</section>

<!--页脚开始-->
<!--网页底部， class.well 用于设置背景效果-->
<footer class="well">
    <!-- class.container 的作用是进行居中布局 -->
    <div class="container">
        <b>Copyright © 2020 ？？.com All Rights Reserved
            <a href="#">啥也不是</a>
            版权所有
        </b> <span class="pull-right"> <b>Version</b> 1.1.0
      </span>
    </div>
</footer>
<!--页脚结束-->
<script type="text/javascript">
    $(document).ready(function () {
            $.ajax({
                "url":"/users/loginnum",
                "type":"get",
                "dataType":"json",
                success:function (json) {
                    console.log(json.data)
                    if (json.data!=null){
                        $("input").removeAttr("disabled")
                        $(".navbar-text").text("管理员："+json.data)
                    }
                },
                "error":function () {
                    $("input").attr("disabled",true)
                    $("#ul").prepend($('<li><a href="' +'http://localhost:8080/web/login.html'+ '">'+"登录"+'</a></li>'))
                    $(".navbar-text").text(" ")
                }
            })

    })
    $("#loginout").bind('click',function () {
        $.ajax({
            "url":"/users/logininfo",
            "type":"get",
            "dataType":"json",
            success:function (json) {
               if(json.state==2000){
                   window.location.href="login.html"
               }
            },
            "error":function () {

                $(".navbar-text").append($('<a href="' +'http://localhost:8080/web/login.html'+ '">'+"登录"+'</a>'))
            }
        })
    })

    $("#btn1").bind('click',function () {
        location.href = "/web/equman.html"
    })

    $("#btn2").bind('click',function (){
        location.href = "/web/brman.html"
    })

    $("#btn3").bind('click',function (){
        location.href = "/web/infoman.html"
    })

    $("#btn4").bind('click',function (){
        location.href = "/web/scrap.html"
    })
    $("#btn5").bind('click',function (){
        location.href = "/web/insert.html"
    })

</script>
</body>
</html>